{# Menu #}

{# dropdown contenu #}
<ul id="user-dropdown" class="dropdown-content">
    <li>
        <a href="{{ path('fos_user_security_login') }}">Connexion</a>
    </li>
    <li class="divider">
    </li>
    <li>
        <a href="{{ path('fos_user_registration_register') }}">Inscription</a>
    </li>
</ul>

<ul id="user-connected-dropdown" class="dropdown-content">
    <li>
        <a href="{{ path('fos_user_profile_show') }}">Profil</a>
    </li>
    <li>
        <a href="{{ path('fos_user_change_password') }}">Changer MDP</a>
    </li>
    <li class="divider">
    </li>
    <li>
        <a href="{{ path('fos_user_security_logout') }}">Logout</a>
    </li>
</ul>

{# NavBar #}
<nav class="blue-grey darken-4">
    <div class="nav-wrapper">
        {% if is_granted("ROLE_ADMIN") %}
            <a href="#" class="brand-logo">&nbsp;BACKEND GLPMR Quizz</a>            
        {% else %}
            <a href="#" class="brand-logo">&nbsp;GLPMR Quizz</a>
        {% endif %}
        <ul class="right side-nav">
            <li>
                <a href="{{ path('glpmr_quizz_homepage') }}">Home</a>
            </li>


            {% if is_granted("IS_AUTHENTICATED_REMEMBERED") %}
                <li>
                    <a class="dropdown-button" href="#!" data-activates="user-connected-dropdown"><i class="mdi-social-person left"></i>{{ app.user.username }}<i class="mdi-navigation-arrow-drop-down right"></i></a>
                </li>
            {% else %}
                <li>
                    <a class="dropdown-button" href="#!" data-activates="user-dropdown"><i class="mdi-social-group left"></i><i class="mdi-navigation-arrow-drop-down right"></i></a>
                </li>
            {% endif %}
        </ul>
    </div>
</nav>

